﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.Data.Xml.Dom;
using Windows.UI.Notifications;

namespace RuneMasterWin8.Common
{
    public class Toast
    {
        /// <summary>
        /// 显示提示信息
        /// </summary>
        public static void ShowToast(String title, String message)
        {
            string toastStr = "<toast duration='short' launch='Page1'>"
                               + "<visual version='1'>"
                               + "<binding template='ToastText02'>"
                               + "<text id='1'>" + title + "</text>"
                               + "<text id='2'>" + message + "</text>"
                               + "</binding>"
                               + "</visual>"
                               + "</toast>";
            XmlDocument toastXml = new XmlDocument();
            toastXml.LoadXml(toastStr);
            ToastNotification toastNotification = new ToastNotification(toastXml);
            ToastNotificationManager.CreateToastNotifier().Show(toastNotification);
        }
    }
}
